<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>RL78 Options (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="RL78 Options (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="RL78 Options (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Submodel-Options.html" rel="up" title="Submodel Options">
<link href="RS_002f6000-and-PowerPC-Options.html" rel="next" title="RS/6000 and PowerPC Options">
<link href="RISC_002dV-Options.html" rel="prev" title="RISC-V Options">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="subsection-level-extent" id="RL78-Options">
<div class="nav-panel">
<p>
Next: <a href="RS_002f6000-and-PowerPC-Options.html" accesskey="n" rel="next">IBM RS/6000 and PowerPC Options</a>, Previous: <a href="RISC_002dV-Options.html" accesskey="p" rel="prev">RISC-V Options</a>, Up: <a href="Submodel-Options.html" accesskey="u" rel="up">Machine-Dependent Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="RL78-Options-1"><span>3.19.41 RL78 Options<a class="copiable-link" href="#RL78-Options-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-RL78-Options"></a>

<dl class="table">
<dt><a id="index-msim-6"></a><span><code class="code">-msim</code><a class="copiable-link" href="#index-msim-6"> &para;</a></span></dt>
<dd><p>Links in additional target libraries to support operation within a
simulator.
</p>
</dd>
<dt><a id="index-mmul"></a><span><code class="code">-mmul=none</code><a class="copiable-link" href="#index-mmul"> &para;</a></span></dt>
<dt><code class="code">-mmul=g10</code></dt>
<dt><code class="code">-mmul=g13</code></dt>
<dt><code class="code">-mmul=g14</code></dt>
<dt><code class="code">-mmul=rl78</code></dt>
<dd><p>Specifies the type of hardware multiplication and division support to
be used.  The simplest is <code class="code">none</code>, which uses software for both
multiplication and division.  This is the default.  The <code class="code">g13</code>
value is for the hardware multiply/divide peripheral found on the
RL78/G13 (S2 core) targets.  The <code class="code">g14</code> value selects the use of
the multiplication and division instructions supported by the RL78/G14
(S3 core) parts.  The value <code class="code">rl78</code> is an alias for <code class="code">g14</code> and
the value <code class="code">mg10</code> is an alias for <code class="code">none</code>.
</p>
<p>In addition a C preprocessor macro is defined, based upon the setting
of this option.  Possible values are: <code class="code">__RL78_MUL_NONE__</code>,
<code class="code">__RL78_MUL_G13__</code> or <code class="code">__RL78_MUL_G14__</code>.
</p>
</dd>
<dt><a id="index-mcpu-9"></a><span><code class="code">-mcpu=g10</code><a class="copiable-link" href="#index-mcpu-9"> &para;</a></span></dt>
<dt><code class="code">-mcpu=g13</code></dt>
<dt><code class="code">-mcpu=g14</code></dt>
<dt><code class="code">-mcpu=rl78</code></dt>
<dd><p>Specifies the RL78 core to target.  The default is the G14 core, also
known as an S3 core or just RL78.  The G13 or S2 core does not have
multiply or divide instructions, instead it uses a hardware peripheral
for these operations.  The G10 or S1 core does not have register
banks, so it uses a different calling convention.
</p>
<p>If this option is set it also selects the type of hardware multiply
support to use, unless this is overridden by an explicit
<samp class="option">-mmul=none</samp> option on the command line.  Thus specifying
<samp class="option">-mcpu=g13</samp> enables the use of the G13 hardware multiply
peripheral and specifying <samp class="option">-mcpu=g10</samp> disables the use of
hardware multiplications altogether.
</p>
<p>Note, although the RL78/G14 core is the default target, specifying
<samp class="option">-mcpu=g14</samp> or <samp class="option">-mcpu=rl78</samp> on the command line does
change the behavior of the toolchain since it also enables G14
hardware multiply support.  If these options are not specified on the
command line then software multiplication routines will be used even
though the code targets the RL78 core.  This is for backwards
compatibility with older toolchains which did not have hardware
multiply and divide support.
</p>
<p>In addition a C preprocessor macro is defined, based upon the setting
of this option.  Possible values are: <code class="code">__RL78_G10__</code>,
<code class="code">__RL78_G13__</code> or <code class="code">__RL78_G14__</code>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-mg13"></a>
<a class="index-entry-id" id="index-mg14"></a>
<a class="index-entry-id" id="index-mrl78"></a>
<a id="index-mg10"></a><span><code class="code">-mg10</code><a class="copiable-link" href="#index-mg10"> &para;</a></span></dt>
<dt><code class="code">-mg13</code></dt>
<dt><code class="code">-mg14</code></dt>
<dt><code class="code">-mrl78</code></dt>
<dd><p>These are aliases for the corresponding <samp class="option">-mcpu=</samp> option.  They
are provided for backwards compatibility.
</p>
</dd>
<dt><a id="index-mallregs"></a><span><code class="code">-mallregs</code><a class="copiable-link" href="#index-mallregs"> &para;</a></span></dt>
<dd><p>Allow the compiler to use all of the available registers.  By default
registers <code class="code">r24..r31</code> are reserved for use in interrupt handlers.
With this option enabled these registers can be used in ordinary
functions as well.
</p>
</dd>
<dt><a class="index-entry-id" id="index-m32bit_002ddoubles"></a>
<a id="index-m64bit_002ddoubles"></a><span><code class="code">-m64bit-doubles</code><a class="copiable-link" href="#index-m64bit_002ddoubles"> &para;</a></span></dt>
<dt><code class="code">-m32bit-doubles</code></dt>
<dd><p>Make the <code class="code">double</code> data type be 64 bits (<samp class="option">-m64bit-doubles</samp>)
or 32 bits (<samp class="option">-m32bit-doubles</samp>) in size.  The default is
<samp class="option">-m32bit-doubles</samp>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-mno_002dsave_002dmduc_002din_002dinterrupts"></a>
<a id="index-msave_002dmduc_002din_002dinterrupts"></a><span><code class="code">-msave-mduc-in-interrupts</code><a class="copiable-link" href="#index-msave_002dmduc_002din_002dinterrupts"> &para;</a></span></dt>
<dt><code class="code">-mno-save-mduc-in-interrupts</code></dt>
<dd><p>Specifies that interrupt handler functions should preserve the
MDUC registers.  This is only necessary if normal code might use
the MDUC registers, for example because it performs multiplication
and division operations.  The default is to ignore the MDUC registers
as this makes the interrupt handlers faster.  The target option -mg13
needs to be passed for this to work as this feature is only available
on the G13 target (S2 core).  The MDUC registers will only be saved
if the interrupt handler performs a multiplication or division
operation or it calls another function.
</p>
</dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="RS_002f6000-and-PowerPC-Options.html">IBM RS/6000 and PowerPC Options</a>, Previous: <a href="RISC_002dV-Options.html">RISC-V Options</a>, Up: <a href="Submodel-Options.html">Machine-Dependent Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
